// 引入pinia 组件
import {defineStore} from 'pinia'
// ref
import { ref } from "vue"

export const useExercisesStore = defineStore("currentExercises",()=>{
  //定义数据
  const currentExercises = ref<API.ExercisesVO[]>([])
  //暴露get方法
  function getCurrentExercises(){
    return currentExercises.value;
  }
  //暴露set方法
  function setCurrentExercises(preparedExercises : API.ExercisesVO[]){
    currentExercises.value = preparedExercises
    console.log(currentExercises.value)
  }

//返回pinia
  return {currentExercises, getCurrentExercises,setCurrentExercises}
})
